package thread.simulation;

/**
 * Title：
 * Description：
 * Created by Myth on 4/18/2017.
 */
public class Consumer implements Runnable{
    private MyNumber myNumber = null;

    public Consumer(MyNumber myNumber) {
        this.myNumber = myNumber;
    }

    @Override
    public void run() {
        for (int i = 0; i < 50; i++) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            myNumber.getNumber();
        }
    }
}
